package com.heima.feign.article;

import com.heima.model.article.dtos.ArticleDto;
import com.heima.model.article.dtos.AuthorDto;
import com.heima.model.media.dtos.WmNewsResultDTO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@FeignClient(value = "leadnews-article")
public interface ArticleFilent {

    @PostMapping("/api/v1/author/save")
     Integer createAuthor(@RequestBody AuthorDto dto);
    @PostMapping("/api/v1/article/save")
    Long createArticle(@RequestBody WmNewsResultDTO resultDTO);

    @GetMapping("/api/v1/article/findByPage")
    List<ArticleDto> findByPage(@RequestParam("page") int page,
                                @RequestParam("size") int size);

    @GetMapping("/api/v1/article/findById/{id}")
    ArticleDto findById(@PathVariable("id") Long id);
}
